﻿using FPSO.Models.Constant;
using FPSO.Models.Domain;
using FPSO.Models.TagMapping;
using Microsoft.Practices.Prism.ViewModel;
using FPSO.Models.ViewModel.Controls;
using Opc.Ua;
using System;
using System.Collections.Generic;
using System.Data.Odbc;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Net.WebRequestMethods;

namespace FPSO.Models.ViewModel.Controls
{
	/// <summary>
	/// 用于所有界面刷新和计算的ViewModel
	/// </summary>
	public class CommStatusViewModel : NotificationObject
	{
		//private List<double> tankvalues = new List<double>();
		private int values_count = 0;

		public double CO5P_Volm { get; set; }
		public double CO5S_Volm { get; set; }
		public double CO4P_Volm { get; set; }
		public double CO4S_Volm { get; set; }
		public double CO3P_Volm { get; set; }
		public double CO3S_Volm { get; set; }
		public double CO2P_Volm { get; set; }
		public double CO2S_Volm { get; set; }
		public double CO1P_Volm { get; set; }
		public double CO1S_Volm { get; set; }
		public double OFFSPEC_Volm { get; set; }
		public double SLOPT1_Volm { get; set; }
		public double SLOPT2_Volm { get; set; }
		public double WB5P_Volm { get; set; }
		public double WB5S_Volm { get; set; }
		public double WB4P_Volm { get; set; }
		public double WB4S_Volm { get; set; }
		public double WB3P_Volm { get; set; }
		public double WB3S_Volm { get; set; }
		public double WB2P_Volm { get; set; }
		public double WB2S_Volm { get; set; }
		public double WB1P_Volm { get; set; }
		public double WB1S_Volm { get; set; }
		public double FPT_Volm { get; set; }
		public double APTP_Volm { get; set; }
		public double APTS_Volm { get; set; }
		public double WB1P_Level { get; set; }
		public double WB1S_Level { get; set; }
		public double WB2P_Level { get; set; }
		public double WB2S_Level { get; set; }
		public double WB3P_Level { get; set; }
		public double WB3S_Level { get; set; }
		public double WB4P_Level { get; set; }
		public double WB4S_Level { get; set; }
		public double WB5P_Level { get; set; }
		public double WB5S_Level { get; set; }
		public double FPT_Level
		{
			get;
			set;
		}
		public double APTP_Level { get; set; }
		public double APTS_Level { get; set; }
		public double CO1P_Level { get; set; }
		public double CO1S_Level { get; set; }
		public double CO2P_Level { get; set; }
		public double CO2S_Level { get; set; }
		public double CO3P_Level { get; set; }
		public double CO3S_Level { get; set; }
		public double CO4P_Level { get; set; }
		public double CO4S_Level { get; set; }
		public double CO5P_Level { get; set; }
		public double CO5S_Level { get; set; }
		public double OFFSPEC_Level { get; set; }
		public double SLOPT1_Level { get; set; }
		public double SLOPT2_Level { get; set; }
		//其他液舱
		public double CFUELOIL_Level { get; set; }
		public double DOT1_Level { get; set; }
		public double DOT2_Level { get; set; }
		public double CDOT_Level { get; set; }
		public double PWP_Level { get; set; }
		public double PWS_Level { get; set; }
		public double TWP_Level { get; set; }
		public double TWS_Level { get; set; }
		public double COOLINGP_Level { get; set; }
		public double COOLINGS_Level { get; set; }
		public double TODT_Level { get; set; }
		public double DODT_Level { get; set; }
		public double DOOVERT_Level { get; set; }
		public double BILGE_Level { get; set; }
		public double DHOT_Level { get; set; }
		public double DOT_Level { get; set; }
		public double SLUDGE_Level { get; set; }
		public double HYDRORE_Level { get; set; }
		public double CHYDRO_Level { get; set; }
		public double EMERFOT_Level { get; set; }
		public double HELIDT_Level { get; set; }

		public double CFUELOIL_Volm { get; set; }
		public double DOT1_Volm { get; set; }
		public double DOT2_Volm { get; set; }
		public double CDOT_Volm { get; set; }
		public double PWP_Volm { get; set; }
		public double PWS_Volm { get; set; }
		public double TWP_Volm { get; set; }
		public double TWS_Volm { get; set; }
		public double COOLINGP_Volm { get; set; }
		public double COOLINGS_Volm { get; set; }
		public double TODT_Volm { get; set; }
		public double DODT_Volm { get; set; }
		public double DOOVERT_Volm { get; set; }
		public double BILGE_Volm { get; set; }
		public double DHOT_Volm { get; set; }
		public double DOT_Volm { get; set; }
		public double SLUDGE_Volm { get; set; }
		public double HYDRORE_Volm { get; set; }
		public double CHYDRO_Volm { get; set; }
		public double EMERFOT_Volm { get; set; }
		public double HELIDT_Volm { get; set; }

		//液舱其他状态
		public double CO5P_Temp_top { get; set; }
		public double CO5S_Temp_top { get; set; }
		public double CO4P_Temp_top { get; set; }
		public double CO4S_Temp_top { get; set; }
		public double CO3P_Temp_top { get; set; }
		public double CO3S_Temp_top { get; set; }
		public double CO2P_Temp_top { get; set; }
		public double CO2S_Temp_top { get; set; }
		public double CO1P_Temp_top { get; set; }
		public double CO1S_Temp_top { get; set; }
		public double OFFSPEC_Temp_top { get; set; }
		public double SLOPT1_Temp_top { get; set; }
		public double SLOPT2_Temp_top { get; set; }

		public double CO5P_Temp_mid { get; set; }
		public double CO5S_Temp_mid { get; set; }
		public double CO4P_Temp_mid { get; set; }
		public double CO4S_Temp_mid { get; set; }
		public double CO3P_Temp_mid { get; set; }
		public double CO3S_Temp_mid { get; set; }
		public double CO2P_Temp_mid { get; set; }
		public double CO2S_Temp_mid { get; set; }
		public double CO1P_Temp_mid { get; set; }
		public double CO1S_Temp_mid { get; set; }
		public double OFFSPEC_Temp_mid { get; set; }
		public double SLOPT1_Temp_mid { get; set; }
		public double SLOPT2_Temp_mid { get; set; }

		public double CO5P_Temp_bottom { get; set; }
		public double CO5S_Temp_bottom { get; set; }
		public double CO4P_Temp_bottom { get; set; }
		public double CO4S_Temp_bottom { get; set; }
		public double CO3P_Temp_bottom { get; set; }
		public double CO3S_Temp_bottom { get; set; }
		public double CO2P_Temp_bottom { get; set; }
		public double CO2S_Temp_bottom { get; set; }
		public double CO1P_Temp_bottom { get; set; }
		public double CO1S_Temp_bottom { get; set; }
		public double OFFSPEC_Temp_bottom { get; set; }
		public double SLOPT1_Temp_bottom { get; set; }
		public double SLOPT2_Temp_bottom { get; set; }

		public double CO5P_Press { get; set; }
		public double CO5S_Press { get; set; }
		public double CO4P_Press { get; set; }
		public double CO4S_Press { get; set; }
		public double CO3P_Press { get; set; }
		public double CO3S_Press { get; set; }
		public double CO2P_Press { get; set; }
		public double CO2S_Press { get; set; }
		public double CO1P_Press { get; set; }
		public double CO1S_Press { get; set; }
		public double OFFSPEC_Press { get; set; }
		public double SLOPT1_Press { get; set; }
		public double SLOPT2_Press { get; set; }

		/// <summary>
		/// 监测横倾
		/// </summary>
		public double REAL_HEEL {  get; set; }
		public double REAL_TRIM { get; set; }

		private double real_midp_draft;
		private double real_mids_draft;
		private double real_aftp_draft;
		private double real_afts_draft;
		private double real_fwdp_draft;
		private double real_fwds_draft;
		/// <summary>
		/// 监测舯吃水(左舷)
		/// </summary>
		public double REAL_MIDP_DRAFT
		{
			get {  return real_midp_draft; }
			set
			{
				real_midp_draft = value;
				REAL_HEEL = Math.Atan((real_midp_draft - real_mids_draft) / ManualCalcResult.ShipB) * 57.3;
			}
		}

		/// <summary>
		/// 监测舯吃水(右舷)
		/// </summary>
		public double REAL_MIDS_DRAFT
		{
			get { return real_mids_draft; }
			set
			{
				real_mids_draft = value;
				REAL_HEEL = Math.Atan((real_midp_draft - real_mids_draft) / ManualCalcResult.ShipB) * 57.3;
			}
		}
		/// <summary>
		/// 监测艉吃水(左舷)
		/// </summary>
		public double REAL_AFTP_DRAFT
		{
			get { return real_aftp_draft; }
			set
			{
				real_aftp_draft = value;
				REAL_TRIM = ((real_aftp_draft + real_afts_draft) - (real_fwdp_draft + real_fwds_draft)) / 2;
			}
		}
		/// <summary>
		/// 监测艉吃水(右舷)
		/// </summary>
		public double REAL_AFTS_DRAFT
		{
			get { return real_afts_draft; }
			set
			{
				real_afts_draft = value;
				REAL_TRIM = ((real_aftp_draft + real_afts_draft) - (real_fwdp_draft + real_fwds_draft)) / 2;
			}
		}

		/// <summary>
		/// 监测艏吃水(左舷)
		/// </summary>
		public double REAL_FWDP_DRAFT
		{
			get { return real_fwdp_draft; }
			set
			{
				real_fwdp_draft = value;
				REAL_TRIM = ((real_aftp_draft + real_afts_draft) - (real_fwdp_draft + real_fwds_draft)) / 2;
			}
		}

		/// <summary>
		/// 监测艏吃水(右舷)
		/// </summary>
		public double REAL_FWDS_DRAFT
		{
			get { return real_fwds_draft; }
			set
			{
				real_fwds_draft = value;
				REAL_TRIM = ((real_aftp_draft + real_afts_draft) - (real_fwdp_draft + real_fwds_draft)) / 2;
			}
		}

		public Dictionary<string, double> GetTankVolumDic()
        {
            Dictionary<string, double> volmDic = new Dictionary<string, double>();
            //List<TankConstant.ConstantTankInfo> constantlist = TankConstant.ConstantList;
            //for(int i = 0;i< constantlist.Count;i++)
            //{
            //    TankConstant.ConstantTankInfo constantlisti = constantlist[i];
            //    volmDic.Add(constantlisti.TankID, tankvolms[i]);
            //}

            volmDic.Add("CO1P", CO1P_Volm);
            volmDic.Add("NO1_COT_S", CO1S_Volm);
            volmDic.Add("NO2_COT_P", CO2P_Volm);
            volmDic.Add("NO2_COT_S", CO2S_Volm);
            volmDic.Add("NO3_COT_P", CO3P_Volm);
            volmDic.Add("NO3_COT_S", CO3S_Volm);
            volmDic.Add("NO4_COT_P", CO4P_Volm);
            volmDic.Add("NO4_COT_S", CO4S_Volm);
            volmDic.Add("NO5_COT_P", CO5P_Volm);
            volmDic.Add("NO5_COT_S", CO5S_Volm);
            volmDic.Add("OFFSPECTANK", OFFSPEC_Volm);
            volmDic.Add("NO1_SLOP", SLOPT1_Volm);
            volmDic.Add("NO2_SLOP", SLOPT2_Volm);

			volmDic.Add("NO1_WBT_P", WB1P_Volm);
            volmDic.Add("NO1_WBT_S", WB1S_Volm);
            volmDic.Add("NO2_WBT_P", WB2P_Volm);
            volmDic.Add("NO2_WBT_S", WB2S_Volm);
            volmDic.Add("NO3_WBT_P", WB3P_Volm);
            volmDic.Add("NO3_WBT_S", WB3S_Volm);
            volmDic.Add("NO4_WBT_P", WB4P_Volm);
            volmDic.Add("NO4_WBT_S", WB4S_Volm);
            volmDic.Add("NO5_WBT_P", WB5P_Volm);
            volmDic.Add("NO5_WBT_S", WB5S_Volm);
            volmDic.Add("FPT", FPT_Volm);
            volmDic.Add("APTP", APTP_Volm);
            volmDic.Add("APTS", APTS_Volm);

			volmDic.Add("CFUELOIL", CFUELOIL_Volm);
			volmDic.Add("DOT1", DOT1_Volm);
			volmDic.Add("DOT2", DOT2_Volm);
			volmDic.Add("CDOT", CDOT_Volm);
			volmDic.Add("PWP", PWP_Volm);
			volmDic.Add("PWS", PWS_Volm);
			volmDic.Add("TWP", TWP_Volm);
			volmDic.Add("TWS", TWS_Volm);
			volmDic.Add("COOLINGP", COOLINGP_Volm);
			volmDic.Add("COOLINGS", COOLINGS_Volm);
			volmDic.Add("TODT", TODT_Volm);
			volmDic.Add("DODT", DODT_Volm);
			volmDic.Add("DOOVERT", DOOVERT_Volm);
			volmDic.Add("BILGE", BILGE_Volm);
			volmDic.Add("DHOT", DHOT_Volm);
			volmDic.Add("DOT", DOT_Volm);
			volmDic.Add("SLUDGE", SLUDGE_Volm);
			volmDic.Add("HYDRORE", HYDRORE_Volm);
			volmDic.Add("CHYDRO", CHYDRO_Volm);
			volmDic.Add("EMERFOT", EMERFOT_Volm);
			volmDic.Add("HELIDT", HELIDT_Volm);
			return volmDic;
        }

        public Dictionary<string, double> GetTankLevelDic()
        {
            Dictionary<string, double> levelDic = new Dictionary<string, double>();
            //List<TankConstant.ConstantTankInfo> constantlist = TankConstant.ConstantList;
            //for (int i = 0; i < constantlist.Count; i++)
            //{
            //    TankConstant.ConstantTankInfo constantlisti = constantlist[i];
            //    levelDic.Add(constantlisti.TankID, tanklevels[i]);
            //}

            levelDic.Add("CO1P", CO1P_Level);
            levelDic.Add("NO1_COT_S", CO1S_Level);
            levelDic.Add("NO2_COT_P", CO2P_Level);
            levelDic.Add("NO2_COT_S", CO2S_Level);
            levelDic.Add("NO3_COT_P", CO3P_Level);
            levelDic.Add("NO3_COT_S", CO3S_Level);
            levelDic.Add("NO4_COT_P", CO4P_Level);
            levelDic.Add("NO4_COT_S", CO4S_Level);
            levelDic.Add("NO5_COT_P", CO5P_Level);
            levelDic.Add("NO5_COT_S", CO5S_Level);
            levelDic.Add("OFFSPECTANK", OFFSPEC_Level);
            levelDic.Add("NO1_SLOP", SLOPT1_Level);
            levelDic.Add("NO2_SLOP", SLOPT2_Level);

			levelDic.Add("NO1_WBT_P", WB1P_Level);
            levelDic.Add("NO1_WBT_S", WB1S_Level);
            levelDic.Add("NO2_WBT_P", WB2P_Level);
            levelDic.Add("NO2_WBT_S", WB2S_Level);
            levelDic.Add("NO3_WBT_P", WB3P_Level);
            levelDic.Add("NO3_WBT_S", WB3S_Level);
            levelDic.Add("NO4_WBT_P", WB4P_Level);
            levelDic.Add("NO4_WBT_S", WB4S_Level);
            levelDic.Add("NO5_WBT_P", WB5P_Level);
            levelDic.Add("NO5_WBT_S", WB5S_Level);
            levelDic.Add("FPT", FPT_Level);
            levelDic.Add("APTP", APTP_Level);
            levelDic.Add("APTS", APTS_Level);

			levelDic.Add("CFUELOIL", CFUELOIL_Level);
			levelDic.Add("DOT1", DOT1_Level);
			levelDic.Add("DOT2", DOT2_Level);
			levelDic.Add("CDOT", CDOT_Level);
			levelDic.Add("PWP", PWP_Level);
			levelDic.Add("PWS", PWS_Level);
			levelDic.Add("TWP", TWP_Level);
			levelDic.Add("TWS", TWS_Level);
			levelDic.Add("COOLINGP", COOLINGP_Level);
			levelDic.Add("COOLINGS", COOLINGS_Level);
			levelDic.Add("TODT", TODT_Level);
			levelDic.Add("DODT", DODT_Level);
			levelDic.Add("DOOVERT", DOOVERT_Level);
			levelDic.Add("BILGE", BILGE_Level);
			levelDic.Add("DHOT", DHOT_Level);
			levelDic.Add("DOT", DOT_Level);
			levelDic.Add("SLUDGE", SLUDGE_Level);
			levelDic.Add("HYDRORE", HYDRORE_Level);
			levelDic.Add("CHYDRO", CHYDRO_Level);
			levelDic.Add("EMERFOT", EMERFOT_Level);
			levelDic.Add("HELIDT", HELIDT_Level);
			return levelDic;
        }

        public ShipDraught GetRealDraught()
        {
            ShipDraught draught = new ShipDraught();
			draught.MidPDraft = REAL_MIDP_DRAFT;
			draught.MidSDraft = REAL_MIDS_DRAFT;
			draught.AftPDraft = REAL_AFTP_DRAFT;
			draught.AftSDraft = REAL_AFTS_DRAFT;
			draught.FwdPDraft = REAL_FWDP_DRAFT;
			draught.FwdSDraft = REAL_FWDS_DRAFT;
            draught.Heel = REAL_HEEL;
            draught.Trim = REAL_TRIM;
            return draught;
        }

		////货舱体积及液位高（待核对）
		//private double no5COTP_Volm;
		//private double no5COTS_Volm;
		//private double no4COTP_Volm;
		//private double no4COTS_Volm;
		//private double no3COTP_Volm;
		//private double no3COTS_Volm;
		//private double no2COTP_Volm;
		//private double no2COTS_Volm;
		//private double no1COTP_Volm;
		//private double no1COTS_Volm;
		//private double offspec_Volm;
		//private double no1SLOP_Volm;
		//private double no2SLOP_Volm;

		//private double no5COTP_Level;
		//private double no5COTS_Level;
		//private double no4COTP_Level;
		//private double no4COTS_Level;
		//private double no3COTP_Level;
		//private double no3COTS_Level;
		//private double no2COTP_Level;
		//private double no2COTS_Level;
		//private double no1COTP_Level;
		//private double no1COTS_Level;
		//private double offspec_Level;
		//private double no1SLOP_Level;
		//private double no2SLOP_Level;

		////压载舱体积及液位高（待核对）
		//private double no5WBTP_Volm;
		//private double no5WBTS_Volm;
		//private double no4WBTP_Volm;
		//private double no4WBTS_Volm;
		//private double no3WBTP_Volm;
		//private double no3WBTS_Volm;
		//private double no2WBTP_Volm;
		//private double no2WBTS_Volm;
		//private double no1WBTP_Volm;
		//private double no1WBTS_Volm;
		//private double fpt_Volm;
		//private double aptp_Volm;
		//private double apts_Volm;

		//private double no5WBTP_Level;
		//private double no5WBTS_Level;
		//private double no4WBTP_Level;
		//private double no4WBTS_Level;
		//private double no3WBTP_Level;
		//private double no3WBTS_Level;
		//private double no2WBTP_Level;
		//private double no2WBTS_Level;
		//private double no1WBTP_Level;
		//private double no1WBTS_Level;
		//private double fpt_Level;
		//private double aptp_Level;
		//private double apts_Level;

		////其他液舱的液位高
		//private double cfueloil_Level;
		//private double dot1_Level;
		//private double dot2_Level;
		//private double cdot_Level;
		//private double pwp_Level;
		//private double pws_Level;
		//private double twp_Level;
		//private double tws_Level;
		//private double coolingp_Level;
		//private double coolings_Level;
		//private double todt_Level;
		//private double dodt_Level;
		//private double doovert_Level;
		//private double bilge_Level;
		//private double dhot_Level;
		//private double dot_Level;
		//private double sludge_Level;
		//private double hydrore_Level;
		//private double chydro_Level;
		//private double emerfot_Level;
		//private double helidt_Level;

		//private double cfueloil_Volm;
		//private double dot1_Volm;
		//private double dot2_Volm;
		//private double cdot_Volm;
		//private double pwp_Volm;
		//private double pws_Volm;
		//private double twp_Volm;
		//private double tws_Volm;
		//private double coolingp_Volm;
		//private double coolings_Volm;
		//private double todt_Volm;
		//private double dodt_Volm;
		//private double doovert_Volm;
		//private double bilge_Volm;
		//private double dhot_Volm;
		//private double dot_Volm;
		//private double sludge_Volm;
		//private double hydrore_Volm;
		//private double chydro_Volm;
		//private double emerfot_Volm;
		//private double helidt_Volm;


		//需要接入opc信号的所有viewmodel控件
		private List<TankOilViewModel> cotTanks = new List<TankOilViewModel>();
		public List<TankOilViewModel> CotTanks
		{
			get
			{
				return cotTanks;
			}
			set
			{
				cotTanks = value;
			}
		}
		private List<TankViewModel> bwtTanks = new List<TankViewModel>();
		public List<TankViewModel> BwtTanks
		{
			get
			{
				return bwtTanks;
			}
			set
			{
				bwtTanks = value;
			}
		}
		public CommStatusViewModel()
		{
			REAL_MIDP_DRAFT = 0d;
			REAL_MIDS_DRAFT = 0d;
			REAL_AFTP_DRAFT = 0d;
			REAL_AFTS_DRAFT = 0d;
			REAL_FWDP_DRAFT = 0d;
			REAL_FWDS_DRAFT = 0d;
			REAL_HEEL = 0d;
			REAL_TRIM = 0d;//8
			values_count += 8;

			CO5P_Volm = 0d;
			CO5S_Volm = 0d;
			CO4P_Volm = 0d;
			CO4S_Volm = 0d;
			CO3P_Volm = 0d;
			CO3S_Volm = 0d;
			CO2P_Volm = 0d;
			CO2S_Volm = 0d;
			CO1P_Volm = 0d;
			CO1S_Volm = 0d;
			OFFSPEC_Volm = 0d;
			SLOPT1_Volm = 0d;
			SLOPT2_Volm = 0d;//13
			values_count += 13;

			CO5P_Level = 0d;
			CO5S_Level = 0d;
			CO4P_Level = 0d;
			CO4S_Level = 0d;
			CO3P_Level = 0d;
			CO3S_Level = 0d;
			CO2P_Level = 0d;
			CO2S_Level = 0d;
			CO1P_Level = 0d;
			CO1S_Level = 0d;
			OFFSPEC_Level = 0d;
			SLOPT1_Level = 0d;
			SLOPT1_Level = 0d;//13
			values_count += 13;

			CO5P_Temp_top = 0d;
			CO5S_Temp_top = 0d;
			CO4P_Temp_top = 0d;
			CO4S_Temp_top = 0d;
			CO3P_Temp_top = 0d;
			CO3S_Temp_top = 0d;
			CO2P_Temp_top = 0d;
			CO2S_Temp_top = 0d;
			CO1P_Temp_top = 0d;
			CO1S_Temp_top = 0d;
			OFFSPEC_Temp_top = 0d;
			SLOPT1_Temp_top = 0d;
			SLOPT2_Temp_top = 0d;//13
			values_count += 13;

			CO5P_Temp_mid = 0d;
			CO5S_Temp_mid = 0d;
			CO4P_Temp_mid = 0d;
			CO4S_Temp_mid = 0d;
			CO3P_Temp_mid = 0d;
			CO3S_Temp_mid = 0d;
			CO2P_Temp_mid = 0d;
			CO2S_Temp_mid = 0d;
			CO1P_Temp_mid = 0d;
			CO1S_Temp_mid = 0d;
			OFFSPEC_Temp_mid = 0d;
			SLOPT1_Temp_mid = 0d;
			SLOPT2_Temp_mid = 0d;//13
			values_count += 13;

			CO5P_Temp_bottom = 0d;
			CO5S_Temp_bottom = 0d;
			CO4P_Temp_bottom = 0d;
			CO4S_Temp_bottom = 0d;
			CO3P_Temp_bottom = 0d;
			CO3S_Temp_bottom = 0d;
			CO2P_Temp_bottom = 0d;
			CO2S_Temp_bottom = 0d;
			CO1P_Temp_bottom = 0d;
			CO1S_Temp_bottom = 0d;
			OFFSPEC_Temp_bottom = 0d;
			SLOPT1_Temp_bottom = 0d;
			SLOPT2_Temp_bottom = 0d;//13
			values_count += 13;

			CO5P_Press = 0d;
			CO5S_Press = 0d;
			CO4P_Press = 0d;
			CO4S_Press = 0d;
			CO3P_Press = 0d;
			CO3S_Press = 0d;
			CO2P_Press = 0d;
			CO2S_Press = 0d;
			CO1P_Press = 0d;
			CO1S_Press = 0d;
			OFFSPEC_Press = 0d;
			SLOPT1_Press = 0d;
			SLOPT2_Press = 0d;//13
			values_count += 13;

			WB5P_Volm = 0d;
			WB5S_Volm = 0d;
			WB4P_Volm = 0d;
			WB4S_Volm = 0d;
			WB3P_Volm = 0d;
			WB3S_Volm = 0d;
			WB2P_Volm = 0d;
			WB2S_Volm = 0d;
			WB1P_Volm = 0d;
			WB1S_Volm = 0d;
			FPT_Volm = 0d;
			APTP_Volm = 0d;
			APTS_Volm = 0d;//13
			values_count += 13;

			WB5P_Level = 0d;
			WB5S_Level = 0d;
			WB4P_Level = 0d;
			WB4S_Level = 0d;
			WB3P_Level = 0d;
			WB3S_Level = 0d;
			WB2P_Level = 0d;
			WB2S_Level = 0d;
			WB1P_Level = 0d;
			WB1S_Level = 0d;
			FPT_Level = 0d;
			APTP_Level = 0d;
			APTS_Level = 0d;//13
			values_count += 13;

			CFUELOIL_Level = 0d;
			DOT1_Level = 0d;
			DOT2_Level = 0d;
			CDOT_Level = 0d;
			PWP_Level = 0d;
			PWS_Level = 0d;
			TWP_Level = 0d;
			TWS_Level = 0d;
			COOLINGP_Level = 0d;
			COOLINGS_Level = 0d;
			TODT_Level = 0d;
			DODT_Level = 0d;
			DOOVERT_Level = 0d;
			BILGE_Level = 0d;
			DHOT_Level = 0d;
			DOT_Level = 0d;
			SLUDGE_Level = 0d;
			HYDRORE_Level = 0d;
			CHYDRO_Level = 0d;
			EMERFOT_Level = 0d;
			HELIDT_Level = 0d;//21
			values_count += 21;

			CFUELOIL_Volm = 0d;
			DOT1_Volm = 0d;
			DOT2_Volm = 0d;
			CDOT_Volm = 0d;
			PWP_Volm = 0d;
			PWS_Volm = 0d;
			TWP_Volm = 0d;
			TWS_Volm = 0d;
			COOLINGP_Volm = 0d;
			COOLINGS_Volm = 0d;
			TODT_Volm = 0d;
			DODT_Volm = 0d;
			DOOVERT_Volm = 0d;
			BILGE_Volm = 0d;
			DHOT_Volm = 0d;
			DOT_Volm = 0d;
			SLUDGE_Volm = 0d;
			HYDRORE_Volm = 0d;
			CHYDRO_Volm = 0d;
			EMERFOT_Volm = 0d;
			HELIDT_Volm = 0d;//21
			values_count += 21;

			//viewmodel初始化
			CO1P = new TankOilViewModel("CO1P", TankConstant.GetTankVolume("CO1P"));
			NO1_COT_S = new TankOilViewModel("NO1_COT_S", TankConstant.GetTankVolume("NO1_COT_S"));
			NO2_COT_P = new TankOilViewModel("NO2_COT_P", TankConstant.GetTankVolume("NO2_COT_P"));
			NO2_COT_S = new TankOilViewModel("NO2_COT_S", TankConstant.GetTankVolume("NO2_COT_S"));
			NO3_COT_P = new TankOilViewModel("NO3_COT_P", TankConstant.GetTankVolume("NO3_COT_P"));
			NO3_COT_S = new TankOilViewModel("NO3_COT_S", TankConstant.GetTankVolume("NO3_COT_S"));
			NO4_COT_P = new TankOilViewModel("NO4_COT_P", TankConstant.GetTankVolume("NO4_COT_P"));
			NO4_COT_S = new TankOilViewModel("NO4_COT_S", TankConstant.GetTankVolume("NO4_COT_S"));
			NO5_COT_P = new TankOilViewModel("NO5_COT_P", TankConstant.GetTankVolume("NO5_COT_P"));
			NO5_COT_S = new TankOilViewModel("NO5_COT_S", TankConstant.GetTankVolume("NO5_COT_S"));
			OFFSPECTANK = new TankOilViewModel("OFFSPECTANK", TankConstant.GetTankVolume("OFFSPECTANK"));
			NO1_SLOP = new TankOilViewModel("NO1_SLOP", TankConstant.GetTankVolume("NO1_SLOP"));
			NO2_SLOP = new TankOilViewModel("NO2_SLOP", TankConstant.GetTankVolume("NO2_SLOP"));
			cotTanks.Add(CO1P);
			cotTanks.Add(NO1_COT_S);
			cotTanks.Add(NO2_COT_P);
			cotTanks.Add(NO2_COT_S);
			cotTanks.Add(NO3_COT_P);
			cotTanks.Add(NO3_COT_S);
			cotTanks.Add(NO4_COT_P);
			cotTanks.Add(NO4_COT_S);
			cotTanks.Add(NO5_COT_P);
			cotTanks.Add(NO5_COT_S);
			cotTanks.Add(OFFSPECTANK);
			cotTanks.Add(NO1_SLOP);
			cotTanks.Add(NO2_SLOP);

			NO1_WBT_P = new TankViewModel("NO1_WBT_P", TankConstant.GetTankVolume("NO1_WBT_P"));
			NO1_WBT_S = new TankViewModel("NO1_WBT_S", TankConstant.GetTankVolume("NO1_WBT_S"));
			NO2_WBT_P = new TankViewModel("NO2_WBT_P", TankConstant.GetTankVolume("NO2_WBT_P"));
			NO2_WBT_S = new TankViewModel("NO2_WBT_S", TankConstant.GetTankVolume("NO2_WBT_S"));
			NO3_WBT_P = new TankViewModel("NO3_WBT_P", TankConstant.GetTankVolume("NO3_WBT_P"));
			NO3_WBT_S = new TankViewModel("NO3_WBT_S", TankConstant.GetTankVolume("NO3_WBT_S"));
			NO4_WBT_P = new TankViewModel("NO4_WBT_P", TankConstant.GetTankVolume("NO4_WBT_P"));
			NO4_WBT_S = new TankViewModel("NO4_WBT_S", TankConstant.GetTankVolume("NO4_WBT_S"));
			NO5_WBT_P = new TankViewModel("NO5_WBT_P", TankConstant.GetTankVolume("NO5_WBT_P"));
			NO5_WBT_S = new TankViewModel("NO5_WBT_S", TankConstant.GetTankVolume("NO5_WBT_S"));
			FPT = new TankViewModel("FPT", TankConstant.GetTankVolume("FPT"));
			APTP = new TankViewModel("APTP", TankConstant.GetTankVolume("APTP"));
			APTS = new TankViewModel("APTS", TankConstant.GetTankVolume("APTS"));
			bwtTanks.Add(NO1_WBT_P);
			bwtTanks.Add(NO1_WBT_S);
			bwtTanks.Add(NO2_WBT_P);
			bwtTanks.Add(NO2_WBT_S);
			bwtTanks.Add(NO3_WBT_P);
			bwtTanks.Add(NO3_WBT_S);
			bwtTanks.Add(NO4_WBT_P);
			bwtTanks.Add(NO4_WBT_S);
			bwtTanks.Add(NO5_WBT_P);
			bwtTanks.Add(NO5_WBT_S);
			bwtTanks.Add(FPT);
			bwtTanks.Add(APTP);
			bwtTanks.Add(APTS);

			hull_bfv_96017 = new ValveViewModel("HULL_BFV_96017");
			hull_bfv_96005 = new ValveViewModel("HULL_BFV_96005");
			hull_bfv_96018 = new ValveViewModel("HULL_BFV_96018");
			hull_bfv_96019 = new ValveViewModel("HULL_BFV_96019");
			hull_bfv_96015 = new ValveViewModel("HULL_BFV_96015");
			hull_bfv_96020 = new ValveViewModel("HULL_BFV_96020");
			hull_bfv_96004 = new ValveViewModel("HULL_BFV_96004");
			hull_bfv_96027 = new ValveViewModel("HULL_BFV_96027");
			hull_bfv_96001 = new ValveViewModel("HULL_BFV_96001");
			hull_bfv_96024 = new ValveViewModel("HULL_BFV_96024");
			hull_bfv_96011 = new ValveViewModel("HULL_BFV_96011");
			hull_bfv_96007 = new ValveViewModel("HULL_BFV_96007");
			hull_bfv_96026 = new ValveViewModel("HULL_BFV_96026");
			hull_bfv_96002 = new ValveViewModel("HULL_BFV_96002");
			hull_bfv_96016 = new ValveViewModel("HULL_BFV_96016");
			hull_bfv_96003 = new ValveViewModel("HULL_BFV_96003");
			hull_bfv_96012 = new ValveViewModel("HULL_BFV_96012");
			hull_bfv_96022 = new ValveViewModel("HULL_BFV_96022");
			hull_bfv_96021 = new ValveViewModel("HULL_BFV_96021");
			hull_bfv_96023 = new ValveViewModel("HULL_BFV_96023");
			hull_bfv_96025 = new ValveViewModel("HULL_BFV_96025");
			hull_bfv_96006 = new ValveViewModel("HULL_BFV_96006");
			hull_bfv_96008 = new ValveViewModel("HULL_BFV_96008");
			hull_bfv_96052 = new ValveViewModel("HULL_BFV_96052");
			hull_bfv_96051 = new ValveViewModel("HULL_BFV_96051");
			hull_bfv_96009 = new ValveViewModel("HULL_BFV_96009");
			hull_bfv_96054 = new ValveViewModel("HULL_BFV_96054");
			hull_bfv_96049 = new ValveViewModel("HULL_BFV_96049");
			hull_bfv_96010 = new ValveViewModel("HULL_BFV_96010");
			hull_bfv_96053 = new ValveViewModel("HULL_BFV_96053");
			hull_bfv_96050 = new ValveViewModel("HULL_BFV_96050");
			hull_bfv_91009 = new ValveViewModel("HULL_BFV_91009");
			hull_bfv_91008 = new ValveViewModel("HULL_BFV_91008");
			hull_bfv_91011 = new ValveViewModel("HULL_BFV_91011");
			hull_bfv_91010 = new ValveViewModel("HULL_BFV_91010");
			hull_bfv_91013 = new ValveViewModel("HULL_BFV_91013");
			hull_bfv_91012 = new ValveViewModel("HULL_BFV_91012");
			hull_bfv_91015 = new ValveViewModel("HULL_BFV_91015");
			hull_bfv_91014 = new ValveViewModel("HULL_BFV_91014");
			hull_bfv_91017 = new ValveViewModel("HULL_BFV_91017");
			hull_bfv_91016 = new ValveViewModel("HULL_BFV_91016");
			hull_bfv_96055 = new ValveViewModel("HULL_BFV_96055");
			
			hull_p_9601A = new PumpViewModel("HULL_P_9601A");
			hull_p_9601B = new PumpViewModel("HULL_P_9601B");

			hull_bfv_91199 = new ValveViewModel("HULL_BFV_91199");
			hull_bfv_91201 = new ValveViewModel("HULL_BFV_91201");
			hull_bfv_91206 = new ValveViewModel("HULL_BFV_91206");
			hull_bfv_91202 = new ValveViewModel("HULL_BFV_91202");
			hull_bfv_91205 = new ValveViewModel("HULL_BFV_91205");
			hull_bfv_91198 = new ValveViewModel("HULL_BFV_91198");
			hull_bfv_91200 = new ValveViewModel("HULL_BFV_91200");
			hull_bfv_91207 = new ValveViewModel("HULL_BFV_91207");
			hull_bfv_91203 = new ValveViewModel("HULL_BFV_91203");
			hull_bfv_91204 = new ValveViewModel("HULL_BFV_91204");
			hull_bfv_91249 = new ValveViewModel("HULL_BFV_91249");
			hull_bfv_91250 = new ValveViewModel("HULL_BFV_91250");
			hull_bfv_91247 = new ValveViewModel("HULL_BFV_91247");
			hull_bfv_91248 = new ValveViewModel("HULL_BFV_91248");
			hull_bfv_91243 = new ValveViewModel("HULL_BFV_91243");
			hull_bfv_91244 = new ValveViewModel("HULL_BFV_91244");
			hull_bfv_91241 = new ValveViewModel("HULL_BFV_91241");
			hull_bfv_91242 = new ValveViewModel("HULL_BFV_91242");
			hull_bfv_91255 = new ValveViewModel("HULL_BFV_91255");
			hull_bfv_91256 = new ValveViewModel("HULL_BFV_91256");
			hull_bfv_91253 = new ValveViewModel("HULL_BFV_91253");
			hull_bfv_91254 = new ValveViewModel("HULL_BFV_91254");
			hull_bfv_91237 = new ValveViewModel("HULL_BFV_91237");
			hull_bfv_91238 = new ValveViewModel("HULL_BFV_91238");
			hull_bfv_91235 = new ValveViewModel("HULL_BFV_91235");
			hull_bfv_91236 = new ValveViewModel("HULL_BFV_91236");
			hull_bfv_91231 = new ValveViewModel("HULL_BFV_91231");
			hull_bfv_91232 = new ValveViewModel("HULL_BFV_91232");
			hull_bfv_91229 = new ValveViewModel("HULL_BFV_91229");
			hull_bfv_91230 = new ValveViewModel("HULL_BFV_91230");
			hull_bfv_91252 = new ValveViewModel("HULL_BFV_91252");
			hull_bfv_91251 = new ValveViewModel("HULL_BFV_91251");
			hull_bfv_91246 = new ValveViewModel("HULL_BFV_91246");
			hull_bfv_91245 = new ValveViewModel("HULL_BFV_91245");
			hull_bfv_91258 = new ValveViewModel("HULL_BFV_91258");
			hull_bfv_91257 = new ValveViewModel("HULL_BFV_91257");
			hull_bfv_91240 = new ValveViewModel("HULL_BFV_91240");
			hull_bfv_91239 = new ValveViewModel("HULL_BFV_91239");
			hull_bfv_91234 = new ValveViewModel("HULL_BFV_91234");
			hull_bfv_91233 = new ValveViewModel("HULL_BFV_91233");

			hull_p_9101A = new PumpViewModel("HULL_P_9101A");
			hull_p_9101B = new PumpViewModel("HULL_P_9101B");
			hull_p_9101C = new PumpViewModel("HULL_P_9101C");
			hull_p_9101D = new PumpViewModel("HULL_P_9101D");
			hull_p_9101E = new PumpViewModel("HULL_P_9101E");
			hull_p_9101F = new PumpViewModel("HULL_P_9101F");
			hull_p_9101G = new PumpViewModel("HULL_P_9101G");
			hull_p_9101H = new PumpViewModel("HULL_P_9101H");
			hull_p_9101I = new PumpViewModel("HULL_P_9101I");
			hull_p_9101J = new PumpViewModel("HULL_P_9101J");
		}

		//压载舱控件（待核对）
		private TankViewModel no5_wbt_p;
		private TankViewModel no4_wbt_p;
		private TankViewModel no3_wbt_p;
		private TankViewModel no2_wbt_p;
		private TankViewModel no1_wbt_p;
		private TankViewModel no5_wbt_s;
		private TankViewModel no4_wbt_s;
		private TankViewModel no3_wbt_s;
		private TankViewModel no2_wbt_s;
		private TankViewModel no1_wbt_s;
		private TankViewModel fpt;
		private TankViewModel aptp;
		private TankViewModel apts;

		[FieldMapper("NO5_WBT_P")]
		public TankViewModel NO5_WBT_P { get { return no5_wbt_p; } set { no5_wbt_p = value; RaisePropertyChanged("NO5_WBT_P"); } }

		[FieldMapper("NO4_WBT_P")]
		public TankViewModel NO4_WBT_P { get { return no4_wbt_p; } set { no4_wbt_p = value; RaisePropertyChanged("NO4_WBT_P"); } }

		[FieldMapper("NO3_WBT_P")]
		public TankViewModel NO3_WBT_P { get { return no3_wbt_p; } set { no3_wbt_p = value; RaisePropertyChanged("NO3_WBT_P"); } }

		[FieldMapper("NO2_WBT_P")]
		public TankViewModel NO2_WBT_P { get { return no2_wbt_p; } set { no2_wbt_p = value; RaisePropertyChanged("NO2_WBT_P"); } }

		[FieldMapper("NO1_WBT_P")]
		public TankViewModel NO1_WBT_P { get { return no1_wbt_p; } set { no1_wbt_p = value; RaisePropertyChanged("NO1_WBT_P"); } }

		[FieldMapper("NO5_WBT_S")]
		public TankViewModel NO5_WBT_S { get { return no5_wbt_s; } set { no5_wbt_s = value; RaisePropertyChanged("NO5_WBT_S"); } }

		[FieldMapper("NO4_WBT_S")]
		public TankViewModel NO4_WBT_S { get { return no4_wbt_s; } set { no4_wbt_s = value; RaisePropertyChanged("NO4_WBT_S"); } }

		[FieldMapper("NO3_WBT_S")]
		public TankViewModel NO3_WBT_S { get { return no3_wbt_s; } set { no3_wbt_s = value; RaisePropertyChanged("NO3_WBT_S"); } }

		[FieldMapper("NO2_WBT_S")]
		public TankViewModel NO2_WBT_S { get { return no2_wbt_s; } set { no2_wbt_s = value; RaisePropertyChanged("NO2_WBT_S"); } }

		[FieldMapper("NO1_WBT_S")]
		public TankViewModel NO1_WBT_S { get { return no1_wbt_s; } set { no1_wbt_s = value; RaisePropertyChanged("NO1_WBT_S"); } }

		[FieldMapper("FPT")]
		public TankViewModel FPT { get { return fpt; } set { fpt = value; RaisePropertyChanged("FPT"); } }
		[FieldMapper("APTP")]
		public TankViewModel APTP { get { return aptp; } set { aptp = value; RaisePropertyChanged("APTP"); } }
		[FieldMapper("APTS")]
		public TankViewModel APTS { get { return apts; } set { apts = value; RaisePropertyChanged("APTS"); } }

		//货油舱控件（待核对）
		private TankOilViewModel no5_cot_p;
		private TankOilViewModel no4_cot_p;
		private TankOilViewModel no3_cot_p;
		private TankOilViewModel no2_cot_p;
		private TankOilViewModel no1_cot_p;
		private TankOilViewModel no5_cot_s;
		private TankOilViewModel no4_cot_s;
		private TankOilViewModel no3_cot_s;
		private TankOilViewModel no2_cot_s;
		private TankOilViewModel no1_cot_s;
		private TankOilViewModel offspectank;
		private TankOilViewModel no1_slop;
		private TankOilViewModel no2_slop;
		[FieldMapper("NO5_COT_P")]
		public TankOilViewModel NO5_COT_P { get { return no5_cot_p; } set { no5_cot_p = value; RaisePropertyChanged("NO5_COT_P"); } }

		[FieldMapper("NO4_COT_P")]
		public TankOilViewModel NO4_COT_P { get { return no4_cot_p; } set { no4_cot_p = value; RaisePropertyChanged("NO4_COT_P"); } }

		[FieldMapper("NO3_COT_P")]
		public TankOilViewModel NO3_COT_P { get { return no3_cot_p; } set { no3_cot_p = value; RaisePropertyChanged("NO3_COT_P"); } }

		[FieldMapper("NO2_COT_P")]
		public TankOilViewModel NO2_COT_P { get { return no2_cot_p; } set { no2_cot_p = value; RaisePropertyChanged("NO2_COT_P"); } }

		[FieldMapper("CO1P")]
		public TankOilViewModel CO1P
		{
			get { return no1_cot_p; }
			set
			{
				no1_cot_p = value;
				RaisePropertyChanged("CO1P");
			}
		}

		[FieldMapper("NO5_COT_S")]
		public TankOilViewModel NO5_COT_S
		{
			get { return no5_cot_s; }
			set
			{
				no5_cot_s = value;
				RaisePropertyChanged("NO5_COT_S");
			}
		}

		[FieldMapper("NO4_COT_S")]
		public TankOilViewModel NO4_COT_S
		{
			get { return no4_cot_s; }
			set
			{
				no4_cot_s = value;
				RaisePropertyChanged("NO4_COT_S");
			}
		}

		[FieldMapper("NO3_COT_S")]
		public TankOilViewModel NO3_COT_S
		{
			get { return no3_cot_s; }
			set
			{
				no3_cot_s = value;
				RaisePropertyChanged("NO3_COT_S");
			}
		}

		[FieldMapper("NO2_COT_S")]
		public TankOilViewModel NO2_COT_S
		{
			get { return no2_cot_s; }
			set
			{
				no2_cot_s = value;
				RaisePropertyChanged("NO2_COT_S");
			}
		}

		[FieldMapper("NO1_COT_S")]
		public TankOilViewModel NO1_COT_S
		{
			get { return no1_cot_s; }
			set
			{
				no1_cot_s = value;
				RaisePropertyChanged("NO1_COT_S");
			}
		}

		[FieldMapper("OFFSPECTANK")]
		public TankOilViewModel OFFSPECTANK
		{
			get { return offspectank; }
			set
			{
				offspectank = value;
				RaisePropertyChanged("OFFSPECTANK");
			}
		}

		[FieldMapper("NO1_SLOP")]
		public TankOilViewModel NO1_SLOP
		{
			get { return no1_slop; }
			set
			{
				no1_slop = value;
				RaisePropertyChanged("NO1_SLOP");
			}
		}


		[FieldMapper("NO2_SLOP")]
		public TankOilViewModel NO2_SLOP
		{
			get { return no2_slop; }
			set
			{
				no2_slop = value;
				RaisePropertyChanged("NO2_SLOP");
			}
		}

		//来自UCOilBallastViewModel
		//阀门控件，需与注入管线图中阀门一一对应（待核对）
		private ValveViewModel hull_bfv_96017;
		private ValveViewModel hull_bfv_96005;
		private ValveViewModel hull_bfv_96018;
		private ValveViewModel hull_bfv_96019;
		private ValveViewModel hull_bfv_96015;
		private ValveViewModel hull_bfv_96020;
		private ValveViewModel hull_bfv_96004;
		private ValveViewModel hull_bfv_96027;
		private ValveViewModel hull_bfv_96001;
		private ValveViewModel hull_bfv_96024;
		private ValveViewModel hull_bfv_96011;
		private ValveViewModel hull_bfv_96007;
		private ValveViewModel hull_bfv_96026;
		private ValveViewModel hull_bfv_96002;
		private ValveViewModel hull_bfv_96016;
		private ValveViewModel hull_bfv_96003;
		private ValveViewModel hull_bfv_96012;
		private ValveViewModel hull_bfv_96022;
		private ValveViewModel hull_bfv_96021;
		private ValveViewModel hull_bfv_96023;
		private ValveViewModel hull_bfv_96025;
		private ValveViewModel hull_bfv_96006;
		private ValveViewModel hull_bfv_96008;
		private ValveViewModel hull_bfv_96052;
		private ValveViewModel hull_bfv_96051;
		private ValveViewModel hull_bfv_96009;
		private ValveViewModel hull_bfv_96054;
		private ValveViewModel hull_bfv_96049;
		private ValveViewModel hull_bfv_96010;
		private ValveViewModel hull_bfv_96053;
		private ValveViewModel hull_bfv_96050;
		private ValveViewModel hull_bfv_91009;
		private ValveViewModel hull_bfv_91008;
		private ValveViewModel hull_bfv_91011;
		private ValveViewModel hull_bfv_91010;
		private ValveViewModel hull_bfv_91013;
		private ValveViewModel hull_bfv_91012;
		private ValveViewModel hull_bfv_91015;
		private ValveViewModel hull_bfv_91014;
		private ValveViewModel hull_bfv_91017;
		private ValveViewModel hull_bfv_91016;
		private ValveViewModel hull_bfv_96055;

		[FieldMapper("HULL_BFV_96017")]
		public ValveViewModel HULL_BFV_96017 { get { return hull_bfv_96017; } set { hull_bfv_96017 = value; RaisePropertyChanged("HULL_BFV_96017"); } }
		[FieldMapper("HULL_BFV_96005")]
		public ValveViewModel HULL_BFV_96005 { get { return hull_bfv_96005; } set { hull_bfv_96005 = value; RaisePropertyChanged("HULL_BFV_96005"); } }
		[FieldMapper("HULL_BFV_96018")]
		public ValveViewModel HULL_BFV_96018 { get { return hull_bfv_96018; } set { hull_bfv_96018 = value; RaisePropertyChanged("HULL_BFV_96018"); } }
		[FieldMapper("HULL_BFV_96019")]
		public ValveViewModel HULL_BFV_96019 { get { return hull_bfv_96019; } set { hull_bfv_96019 = value; RaisePropertyChanged("HULL_BFV_96019"); } }
		[FieldMapper("HULL_BFV_96015")]
		public ValveViewModel HULL_BFV_96015 { get { return hull_bfv_96015; } set { hull_bfv_96015 = value; RaisePropertyChanged("HULL_BFV_96015"); } }
		[FieldMapper("HULL_BFV_96020")]
		public ValveViewModel HULL_BFV_96020 { get { return hull_bfv_96020; } set { hull_bfv_96020 = value; RaisePropertyChanged("HULL_BFV_96020"); } }
		[FieldMapper("HULL_BFV_96004")]
		public ValveViewModel HULL_BFV_96004 { get { return hull_bfv_96004; } set { hull_bfv_96004 = value; RaisePropertyChanged("HULL_BFV_96004"); } }
		[FieldMapper("HULL_BFV_96027")]
		public ValveViewModel HULL_BFV_96027 { get { return hull_bfv_96027; } set { hull_bfv_96027 = value; RaisePropertyChanged("HULL_BFV_96027"); } }
		[FieldMapper("HULL_BFV_96001")]
		public ValveViewModel HULL_BFV_96001 { get { return hull_bfv_96001; } set { hull_bfv_96001 = value; RaisePropertyChanged("HULL_BFV_96001"); } }
		[FieldMapper("HULL_BFV_96024")]
		public ValveViewModel HULL_BFV_96024 { get { return hull_bfv_96024; } set { hull_bfv_96024 = value; RaisePropertyChanged("HULL_BFV_96024"); } }
		[FieldMapper("HULL_BFV_96011")]
		public ValveViewModel HULL_BFV_96011 { get { return hull_bfv_96011; } set { hull_bfv_96011 = value; RaisePropertyChanged("HULL_BFV_96011"); } }
		[FieldMapper("HULL_BFV_96007")]
		public ValveViewModel HULL_BFV_96007 { get { return hull_bfv_96007; } set { hull_bfv_96007 = value; RaisePropertyChanged("HULL_BFV_96007"); } }
		[FieldMapper("HULL_BFV_96026")]
		public ValveViewModel HULL_BFV_96026 { get { return hull_bfv_96026; } set { hull_bfv_96026 = value; RaisePropertyChanged("HULL_BFV_96026"); } }
		[FieldMapper("HULL_BFV_96002")]
		public ValveViewModel HULL_BFV_96002 { get { return hull_bfv_96002; } set { hull_bfv_96002 = value; RaisePropertyChanged("HULL_BFV_96002"); } }
		[FieldMapper("HULL_BFV_96016")]
		public ValveViewModel HULL_BFV_96016 { get { return hull_bfv_96016; } set { hull_bfv_96016 = value; RaisePropertyChanged("HULL_BFV_96016"); } }
		[FieldMapper("HULL_BFV_96003")]
		public ValveViewModel HULL_BFV_96003 { get { return hull_bfv_96003; } set { hull_bfv_96003 = value; RaisePropertyChanged("HULL_BFV_96003"); } }
		[FieldMapper("HULL_BFV_96012")]
		public ValveViewModel HULL_BFV_96012 { get { return hull_bfv_96012; } set { hull_bfv_96012 = value; RaisePropertyChanged("HULL_BFV_96012"); } }
		[FieldMapper("HULL_BFV_96022")]
		public ValveViewModel HULL_BFV_96022 { get { return hull_bfv_96022; } set { hull_bfv_96022 = value; RaisePropertyChanged("HULL_BFV_96022"); } }
		[FieldMapper("HULL_BFV_96021")]
		public ValveViewModel HULL_BFV_96021 { get { return hull_bfv_96021; } set { hull_bfv_96021 = value; RaisePropertyChanged("HULL_BFV_96021"); } }
		[FieldMapper("HULL_BFV_96023")]
		public ValveViewModel HULL_BFV_96023 { get { return hull_bfv_96023; } set { hull_bfv_96023 = value; RaisePropertyChanged("HULL_BFV_96023"); } }
		[FieldMapper("HULL_BFV_96025")]
		public ValveViewModel HULL_BFV_96025 { get { return hull_bfv_96025; } set { hull_bfv_96025 = value; RaisePropertyChanged("HULL_BFV_96025"); } }
		[FieldMapper("HULL_BFV_96006")]
		public ValveViewModel HULL_BFV_96006 { get { return hull_bfv_96006; } set { hull_bfv_96006 = value; RaisePropertyChanged("HULL_BFV_96006"); } }
		[FieldMapper("HULL_BFV_96008")]
		public ValveViewModel HULL_BFV_96008 { get { return hull_bfv_96008; } set { hull_bfv_96008 = value; RaisePropertyChanged("HULL_BFV_96008"); } }
		[FieldMapper("HULL_BFV_96052")]
		public ValveViewModel HULL_BFV_96052 { get { return hull_bfv_96052; } set { hull_bfv_96052 = value; RaisePropertyChanged("HULL_BFV_96052"); } }
		[FieldMapper("HULL_BFV_96051")]
		public ValveViewModel HULL_BFV_96051 { get { return hull_bfv_96051; } set { hull_bfv_96051 = value; RaisePropertyChanged("HULL_BFV_96051"); } }
		[FieldMapper("HULL_BFV_96009")]
		public ValveViewModel HULL_BFV_96009 { get { return hull_bfv_96009; } set { hull_bfv_96009 = value; RaisePropertyChanged("HULL_BFV_96009"); } }
		[FieldMapper("HULL_BFV_96054")]
		public ValveViewModel HULL_BFV_96054 { get { return hull_bfv_96054; } set { hull_bfv_96054 = value; RaisePropertyChanged("HULL_BFV_96054"); } }
		[FieldMapper("HULL_BFV_96049")]
		public ValveViewModel HULL_BFV_96049 { get { return hull_bfv_96049; } set { hull_bfv_96049 = value; RaisePropertyChanged("HULL_BFV_96049"); } }
		[FieldMapper("HULL_BFV_96010")]
		public ValveViewModel HULL_BFV_96010 { get { return hull_bfv_96010; } set { hull_bfv_96010 = value; RaisePropertyChanged("HULL_BFV_96010"); } }
		[FieldMapper("HULL_BFV_96053")]
		public ValveViewModel HULL_BFV_96053 { get { return hull_bfv_96053; } set { hull_bfv_96053 = value; RaisePropertyChanged("HULL_BFV_96053"); } }
		[FieldMapper("HULL_BFV_96050")]
		public ValveViewModel HULL_BFV_96050 { get { return hull_bfv_96050; } set { hull_bfv_96050 = value; RaisePropertyChanged("HULL_BFV_96050"); } }
		[FieldMapper("HULL_BFV_91009")]
		public ValveViewModel HULL_BFV_91009 { get { return hull_bfv_91009; } set { hull_bfv_91009 = value; RaisePropertyChanged("HULL_BFV_91009"); } }
		[FieldMapper("HULL_BFV_91008")]
		public ValveViewModel HULL_BFV_91008
		{
			get
			{
				return hull_bfv_91008;
			}
			set
			{
				hull_bfv_91008 = value;
				RaisePropertyChanged("HULL_BFV_91008");
			}
		}
		[FieldMapper("HULL_BFV_91011")]
		public ValveViewModel HULL_BFV_91011 { get { return hull_bfv_91011; } set { hull_bfv_91011 = value; RaisePropertyChanged("HULL_BFV_91011"); } }
		[FieldMapper("HULL_BFV_91010")]
		public ValveViewModel HULL_BFV_91010 { get { return hull_bfv_91010; } set { hull_bfv_91010 = value; RaisePropertyChanged("HULL_BFV_91010"); } }
		[FieldMapper("HULL_BFV_91013")]
		public ValveViewModel HULL_BFV_91013 { get { return hull_bfv_91013; } set { hull_bfv_91013 = value; RaisePropertyChanged("HULL_BFV_91013"); } }
		[FieldMapper("HULL_BFV_91012")]
		public ValveViewModel HULL_BFV_91012 { get { return hull_bfv_91012; } set { hull_bfv_91012 = value; RaisePropertyChanged("HULL_BFV_91012"); } }
		[FieldMapper("HULL_BFV_91015")]
		public ValveViewModel HULL_BFV_91015 { get { return hull_bfv_91015; } set { hull_bfv_91015 = value; RaisePropertyChanged("HULL_BFV_91015"); } }
		[FieldMapper("HULL_BFV_91014")]
		public ValveViewModel HULL_BFV_91014 { get { return hull_bfv_91014; } set { hull_bfv_91014 = value; RaisePropertyChanged("HULL_BFV_91014"); } }
		[FieldMapper("HULL_BFV_91017")]
		public ValveViewModel HULL_BFV_91017 { get { return hull_bfv_91017; } set { hull_bfv_91017 = value; RaisePropertyChanged("HULL_BFV_91017"); } }
		[FieldMapper("HULL_BFV_91016")]
		public ValveViewModel HULL_BFV_91016 { get { return hull_bfv_91016; } set { hull_bfv_91016 = value; RaisePropertyChanged("HULL_BFV_91016"); } }

		[FieldMapper("HULL_BFV_96055")]
		public ValveViewModel HULL_BFV_96055 { get { return hull_bfv_96055; } set { hull_bfv_96055 = value; RaisePropertyChanged("HULL_BFV_96055"); } }
		//泵控件，需与注入管线图中泵一一对应（待核对）
		private PumpViewModel hull_p_9601A;
		private PumpViewModel hull_p_9601B;

		[FieldMapper("HULL_P_9601A")]
		public PumpViewModel HULL_P_9601A
		{
			get { return hull_p_9601A; }
			set
			{
				hull_p_9601A = value;
				RaisePropertyChanged("HULL_P_9601A");
			}
		}

		[FieldMapper("HULL_P_9601B")]
		public PumpViewModel HULL_P_9601B
		{
			get { return hull_p_9601B; }
			set
			{
				hull_p_9601B = value;
				RaisePropertyChanged("HULL_P_9601B");
			}
		}

		//来自UCOutAndSwapViewModel
		//阀门控件，需与外输、导舱管线图中阀门一一对应（待核对）
		private ValveViewModel hull_bfv_91199;
		private ValveViewModel hull_bfv_91201;
		private ValveViewModel hull_bfv_91206;
		private ValveViewModel hull_bfv_91202;
		private ValveViewModel hull_bfv_91205;
		private ValveViewModel hull_bfv_91198;
		private ValveViewModel hull_bfv_91200;
		private ValveViewModel hull_bfv_91207;
		private ValveViewModel hull_bfv_91203;
		private ValveViewModel hull_bfv_91204;
		private ValveViewModel hull_bfv_91249;
		private ValveViewModel hull_bfv_91250;
		private ValveViewModel hull_bfv_91247;
		private ValveViewModel hull_bfv_91248;
		private ValveViewModel hull_bfv_91243;
		private ValveViewModel hull_bfv_91244;
		private ValveViewModel hull_bfv_91241;
		private ValveViewModel hull_bfv_91242;
		private ValveViewModel hull_bfv_91255;
		private ValveViewModel hull_bfv_91256;
		private ValveViewModel hull_bfv_91253;
		private ValveViewModel hull_bfv_91254;
		private ValveViewModel hull_bfv_91237;
		private ValveViewModel hull_bfv_91238;
		private ValveViewModel hull_bfv_91235;
		private ValveViewModel hull_bfv_91236;
		private ValveViewModel hull_bfv_91231;
		private ValveViewModel hull_bfv_91232;
		private ValveViewModel hull_bfv_91229;
		private ValveViewModel hull_bfv_91230;
		private ValveViewModel hull_bfv_91252;
		private ValveViewModel hull_bfv_91251;
		private ValveViewModel hull_bfv_91246;
		private ValveViewModel hull_bfv_91245;
		private ValveViewModel hull_bfv_91258;
		private ValveViewModel hull_bfv_91257;
		private ValveViewModel hull_bfv_91240;
		private ValveViewModel hull_bfv_91239;
		private ValveViewModel hull_bfv_91234;
		private ValveViewModel hull_bfv_91233;

		[FieldMapper("HULL_BFV_91199")]
		public ValveViewModel HULL_BFV_91199 { get { return hull_bfv_91199; } set { hull_bfv_91199 = value; RaisePropertyChanged("HULL_BFV_91199"); } }
		[FieldMapper("HULL_BFV_91201")]
		public ValveViewModel HULL_BFV_91201 { get { return hull_bfv_91201; } set { hull_bfv_91201 = value; RaisePropertyChanged("HULL_BFV_91201"); } }
		[FieldMapper("HULL_BFV_91206")]
		public ValveViewModel HULL_BFV_91206 { get { return hull_bfv_91206; } set { hull_bfv_91206 = value; RaisePropertyChanged("HULL_BFV_91206"); } }
		[FieldMapper("HULL_BFV_91202")]
		public ValveViewModel HULL_BFV_91202 { get { return hull_bfv_91202; } set { hull_bfv_91202 = value; RaisePropertyChanged("HULL_BFV_91202"); } }
		[FieldMapper("HULL_BFV_91205")]
		public ValveViewModel HULL_BFV_91205 { get { return hull_bfv_91205; } set { hull_bfv_91205 = value; RaisePropertyChanged("HULL_BFV_91205"); } }
		[FieldMapper("HULL_BFV_91198")]
		public ValveViewModel HULL_BFV_91198 { get { return hull_bfv_91198; } set { hull_bfv_91198 = value; RaisePropertyChanged("HULL_BFV_91198"); } }
		[FieldMapper("HULL_BFV_91200")]
		public ValveViewModel HULL_BFV_91200 { get { return hull_bfv_91200; } set { hull_bfv_91200 = value; RaisePropertyChanged("HULL_BFV_91200"); } }
		[FieldMapper("HULL_BFV_91207")]
		public ValveViewModel HULL_BFV_91207 { get { return hull_bfv_91207; } set { hull_bfv_91207 = value; RaisePropertyChanged("HULL_BFV_91207"); } }
		[FieldMapper("HULL_BFV_91203")]
		public ValveViewModel HULL_BFV_91203 { get { return hull_bfv_91203; } set { hull_bfv_91203 = value; RaisePropertyChanged("HULL_BFV_91203"); } }
		[FieldMapper("HULL_BFV_91204")]
		public ValveViewModel HULL_BFV_91204 { get { return hull_bfv_91204; } set { hull_bfv_91204 = value; RaisePropertyChanged("HULL_BFV_91204"); } }
		[FieldMapper("HULL_BFV_91249")]
		public ValveViewModel HULL_BFV_91249 { get { return hull_bfv_91249; } set { hull_bfv_91249 = value; RaisePropertyChanged("HULL_BFV_91249"); } }
		[FieldMapper("HULL_BFV_91250")]
		public ValveViewModel HULL_BFV_91250 { get { return hull_bfv_91250; } set { hull_bfv_91250 = value; RaisePropertyChanged("HULL_BFV_91250"); } }
		[FieldMapper("HULL_BFV_91247")]
		public ValveViewModel HULL_BFV_91247 { get { return hull_bfv_91247; } set { hull_bfv_91247 = value; RaisePropertyChanged("HULL_BFV_91247"); } }
		[FieldMapper("HULL_BFV_91248")]
		public ValveViewModel HULL_BFV_91248 { get { return hull_bfv_91248; } set { hull_bfv_91248 = value; RaisePropertyChanged("HULL_BFV_91248"); } }
		[FieldMapper("HULL_BFV_91243")]
		public ValveViewModel HULL_BFV_91243 { get { return hull_bfv_91243; } set { hull_bfv_91243 = value; RaisePropertyChanged("HULL_BFV_91243"); } }
		[FieldMapper("HULL_BFV_91244")]
		public ValveViewModel HULL_BFV_91244 { get { return hull_bfv_91244; } set { hull_bfv_91244 = value; RaisePropertyChanged("HULL_BFV_91244"); } }
		[FieldMapper("HULL_BFV_91241")]
		public ValveViewModel HULL_BFV_91241 { get { return hull_bfv_91241; } set { hull_bfv_91241 = value; RaisePropertyChanged("HULL_BFV_91241"); } }
		[FieldMapper("HULL_BFV_91242")]
		public ValveViewModel HULL_BFV_91242 { get { return hull_bfv_91242; } set { hull_bfv_91242 = value; RaisePropertyChanged("HULL_BFV_91242"); } }
		[FieldMapper("HULL_BFV_91255")]
		public ValveViewModel HULL_BFV_91255 { get { return hull_bfv_91255; } set { hull_bfv_91255 = value; RaisePropertyChanged("HULL_BFV_91255"); } }
		[FieldMapper("HULL_BFV_91256")]
		public ValveViewModel HULL_BFV_91256 { get { return hull_bfv_91256; } set { hull_bfv_91256 = value; RaisePropertyChanged("HULL_BFV_91256"); } }
		[FieldMapper("HULL_BFV_91253")]
		public ValveViewModel HULL_BFV_91253 { get { return hull_bfv_91253; } set { hull_bfv_91253 = value; RaisePropertyChanged("HULL_BFV_91253"); } }
		[FieldMapper("HULL_BFV_91254")]
		public ValveViewModel HULL_BFV_91254 { get { return hull_bfv_91254; } set { hull_bfv_91254 = value; RaisePropertyChanged("HULL_BFV_91254"); } }
		[FieldMapper("HULL_BFV_91237")]
		public ValveViewModel HULL_BFV_91237 { get { return hull_bfv_91237; } set { hull_bfv_91237 = value; RaisePropertyChanged("HULL_BFV_91237"); } }
		[FieldMapper("HULL_BFV_91238")]
		public ValveViewModel HULL_BFV_91238 { get { return hull_bfv_91238; } set { hull_bfv_91238 = value; RaisePropertyChanged("HULL_BFV_91238"); } }
		[FieldMapper("HULL_BFV_91235")]
		public ValveViewModel HULL_BFV_91235 { get { return hull_bfv_91235; } set { hull_bfv_91235 = value; RaisePropertyChanged("HULL_BFV_91235"); } }
		[FieldMapper("HULL_BFV_91236")]
		public ValveViewModel HULL_BFV_91236 { get { return hull_bfv_91236; } set { hull_bfv_91236 = value; RaisePropertyChanged("HULL_BFV_91236"); } }
		[FieldMapper("HULL_BFV_91231")]
		public ValveViewModel HULL_BFV_91231 { get { return hull_bfv_91231; } set { hull_bfv_91231 = value; RaisePropertyChanged("HULL_BFV_91231"); } }
		[FieldMapper("HULL_BFV_91232")]
		public ValveViewModel HULL_BFV_91232 { get { return hull_bfv_91232; } set { hull_bfv_91232 = value; RaisePropertyChanged("HULL_BFV_91232"); } }
		[FieldMapper("HULL_BFV_91229")]
		public ValveViewModel HULL_BFV_91229 { get { return hull_bfv_91229; } set { hull_bfv_91229 = value; RaisePropertyChanged("HULL_BFV_91229"); } }
		[FieldMapper("HULL_BFV_91230")]
		public ValveViewModel HULL_BFV_91230 { get { return hull_bfv_91230; } set { hull_bfv_91230 = value; RaisePropertyChanged("HULL_BFV_91230"); } }
		[FieldMapper("HULL_BFV_91252")]
		public ValveViewModel HULL_BFV_91252 { get { return hull_bfv_91252; } set { hull_bfv_91252 = value; RaisePropertyChanged("HULL_BFV_91252"); } }
		[FieldMapper("HULL_BFV_91251")]
		public ValveViewModel HULL_BFV_91251 { get { return hull_bfv_91251; } set { hull_bfv_91251 = value; RaisePropertyChanged("HULL_BFV_91251"); } }
		[FieldMapper("HULL_BFV_91246")]
		public ValveViewModel HULL_BFV_91246 { get { return hull_bfv_91246; } set { hull_bfv_91246 = value; RaisePropertyChanged("HULL_BFV_91246"); } }
		[FieldMapper("HULL_BFV_91245")]
		public ValveViewModel HULL_BFV_91245 { get { return hull_bfv_91245; } set { hull_bfv_91245 = value; RaisePropertyChanged("HULL_BFV_91245"); } }
		[FieldMapper("HULL_BFV_91258")]
		public ValveViewModel HULL_BFV_91258 { get { return hull_bfv_91258; } set { hull_bfv_91258 = value; RaisePropertyChanged("HULL_BFV_91258"); } }
		[FieldMapper("HULL_BFV_91257")]
		public ValveViewModel HULL_BFV_91257 { get { return hull_bfv_91257; } set { hull_bfv_91257 = value; RaisePropertyChanged("HULL_BFV_91257"); } }
		[FieldMapper("HULL_BFV_91240")]
		public ValveViewModel HULL_BFV_91240 { get { return hull_bfv_91240; } set { hull_bfv_91240 = value; RaisePropertyChanged("HULL_BFV_91240"); } }
		[FieldMapper("HULL_BFV_91239")]
		public ValveViewModel HULL_BFV_91239 { get { return hull_bfv_91239; } set { hull_bfv_91239 = value; RaisePropertyChanged("HULL_BFV_91239"); } }
		[FieldMapper("HULL_BFV_91234")]
		public ValveViewModel HULL_BFV_91234 { get { return hull_bfv_91234; } set { hull_bfv_91234 = value; RaisePropertyChanged("HULL_BFV_91234"); } }
		[FieldMapper("HULL_BFV_91233")]
		public ValveViewModel HULL_BFV_91233 { get { return hull_bfv_91233; } set { hull_bfv_91233 = value; RaisePropertyChanged("HULL_BFV_91233"); } }

		//泵控件，需与外输、导舱管线图中泵一一对应（待核对）
		private PumpViewModel hull_p_9101A;
		private PumpViewModel hull_p_9101B;
		private PumpViewModel hull_p_9101C;
		private PumpViewModel hull_p_9101D;
		private PumpViewModel hull_p_9101E;
		private PumpViewModel hull_p_9101F;
		private PumpViewModel hull_p_9101G;
		private PumpViewModel hull_p_9101H;
		private PumpViewModel hull_p_9101I;
		private PumpViewModel hull_p_9101J;

		[FieldMapper("HULL_P_9101A")]
		public PumpViewModel HULL_P_9101A { get { return hull_p_9101A; } set { hull_p_9101A = value; RaisePropertyChanged("HULL_P_9101A"); } }
		[FieldMapper("HULL_P_9101B")]
		public PumpViewModel HULL_P_9101B { get { return hull_p_9101B; } set { hull_p_9101B = value; RaisePropertyChanged("HULL_P_9101B"); } }
		[FieldMapper("HULL_P_9101C")]
		public PumpViewModel HULL_P_9101C { get { return hull_p_9101C; } set { hull_p_9101C = value; RaisePropertyChanged("HULL_P_9101C"); } }
		[FieldMapper("HULL_P_9101D")]
		public PumpViewModel HULL_P_9101D { get { return hull_p_9101D; } set { hull_p_9101D = value; RaisePropertyChanged("HULL_P_9101D"); } }
		[FieldMapper("HULL_P_9101E")]
		public PumpViewModel HULL_P_9101E { get { return hull_p_9101E; } set { hull_p_9101E = value; RaisePropertyChanged("HULL_P_9101E"); } }
		[FieldMapper("HULL_P_9101F")]
		public PumpViewModel HULL_P_9101F { get { return hull_p_9101F; } set { hull_p_9101F = value; RaisePropertyChanged("HULL_P_9101F"); } }
		[FieldMapper("HULL_P_9101G")]
		public PumpViewModel HULL_P_9101G { get { return hull_p_9101G; } set { hull_p_9101G = value; RaisePropertyChanged("HULL_P_9101G"); } }
		[FieldMapper("HULL_P_9101H")]
		public PumpViewModel HULL_P_9101H { get { return hull_p_9101H; } set { hull_p_9101H = value; RaisePropertyChanged("HULL_P_9101H"); } }
		[FieldMapper("HULL_P_9101I")]
		public PumpViewModel HULL_P_9101I { get { return hull_p_9101I; } set { hull_p_9101I = value; RaisePropertyChanged("HULL_P_9101I"); } }
		[FieldMapper("HULL_P_9101J")]
		public PumpViewModel HULL_P_9101J { get { return hull_p_9101J; } set { hull_p_9101J = value; RaisePropertyChanged("HULL_P_9101J"); } }

		//下面的暂时没用
		public void SetBFVActive(string bfvName, bool active)
		{
			switch (bfvName.ToUpper().Trim())
			{
			}
		}

		public TankOilViewModel GetCotViewModel(string tankId)
		{
			foreach (TankOilViewModel tankOilViewModel in cotTanks)
			{
				if (tankOilViewModel.TankId == tankId)
				{
					return tankOilViewModel;
				}
			}
			return null;
		}
		public TankViewModel GetBwtViewModel(string tankId)
		{
			foreach (TankViewModel tankViewModel in bwtTanks)
			{
				if (tankViewModel.TankId == tankId)
				{
					return tankViewModel;
				}
			}
			return null;
		}
	}
}
